package com.wymobilearchitecture.study.recyclerview

import android.os.Bundle
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView

import com.wymobilearchitecture.R
import com.wy.common.base.BaseActivity
import com.wy.w_ui.ui.recyclerview.WAdapter
import com.wy.w_ui.ui.recyclerview.WDataItem
import kotlinx.android.synthetic.main.activity_recycler_view.*


/**
 * RecyclerView  源码分析时使用
 */
class RecyclerViewActivity : BaseActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContentView(R.layout.activity_recycler_view)

        var adapter : WAdapter = WAdapter(this)
        recycler_view.adapter = adapter
        recycler_view.layoutManager = GridLayoutManager(this,2)

        var dataSet  = ArrayList<WDataItem<*,RecyclerView.ViewHolder>>()
        dataSet.add(TopTabDataItem(ItemData()))


        adapter.addItems(dataSet,false)
    }
}